#include <hardware/switch/switch.h>

void initSwitch()
{
    pinMode(LIMIT_SWITCH_FWD, INPUT);
    pinMode(LIMIT_SWITCH_REV, INPUT);
    //digitalWrite用于控制引脚的高电平（HIGH）或低电平（LOW），适用于开关控制。
    digitalWrite(LIMIT_SWITCH_FWD, HIGH);
    digitalWrite(LIMIT_SWITCH_REV, HIGH);
}
int getStatusForForward()
{
    return digitalRead(LIMIT_SWITCH_FWD);
}

int getStatusForReverse()
{
    return digitalRead(LIMIT_SWITCH_REV);
}
